import QtQuick 1.1
import com.nokia.meego 1.0
import com.nokia.extras 1.1

PageStackWindow {
    id: appWindow
    initialPage: loginPage
    LoginPage { id: loginPage }
//    MainPage { id: mainPage }

//    initialPage: testPage
//    TestPage { id: testPage }

    InfoBanner {
        id: errorBanner
        topMargin: 64
        timerShowTime: 5000
        text: qsTr("Something went wrong")
    }

    Connections {
        target: rosYama
        onErrorMessage: {
            errorBanner.text = error
            errorBanner.show()
        }
    }

    ToolBarLayout {
        id: commonTools
        anchors.bottom: parent.bottom
        ToolIcon {
            platformIconId: "toolbar-view-menu"
            anchors.right: (parent === undefined) ? undefined : parent.right
            onClicked: (mainMenu.status == DialogStatus.Closed) ? mainMenu.open() : mainMenu.close()
        }
    }
    Menu {
        id: mainMenu
        visualParent: pageStack
        MenuLayout {
            MenuItem { text: qsTr("Help") }
            MenuItem { text: qsTr("About"); onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml")) }
        }
    }
}
